package isssr.boundary.src;

import isssr.control.src.UserAdministrationControl;
import isssr.entity.src.Perspective;
import isssr.entity.src.UserDTO;

import java.io.Serializable;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.ManagedProperty;
import javax.faces.bean.SessionScoped;

@ManagedBean(name="userAdministrationBoundary")
@SessionScoped
public class UserAdministrationBoundary implements Serializable {

	private static final long serialVersionUID = -5312118642535565945L;
	
	@ManagedProperty(value="#{userAdministrationControl}")
	private UserAdministrationControl ctrl;
	
	private UserDTO userData;
	
	
	public UserAdministrationBoundary(){
	}
	

	public void setCtrl(UserAdministrationControl ctrl) {
		this.ctrl = ctrl;
	}

	
	public UserDTO getUserData() {
		return userData;
	}

	
	public void setUserData(UserDTO data) {
		this.userData = data;
	}
	

	public String setOwnerPerspective() {
		return this.ctrl.changeUserPerspective(Perspective.OWNER_VIEW);
	}
	
	
	public String setSuperOwnerPerspective() {
		return this.ctrl.changeUserPerspective(Perspective.SUPER_OWNER_VIEW);
	}
	
	
	public String setEnactorPerspective() {
		return this.ctrl.changeUserPerspective(Perspective.ENACTOR_VIEW);
	}
	
	
	public String logout() {
		return null;
	}
	
}
